#pragma once

#include "PreProcDOM.hpp"

namespace CPreProc
{
  class IfDefCondition : public IfGroupCondition
  {
  public:
    enum ParseFlags
    {
      ParseFlag_IsIfNDef        = (1 << 0),
    };
    static Glib::RefPtr<IfDefCondition> parse(Tokenizer &tokenizer,int flags);

    IfDefCondition(const Glib::ustring &macro_name,bool is_ifndef);

    virtual bool      evaluate(PreProcessorContext &context);

    virtual void      load(BuildNG::InStream &src);
    virtual void      save(BuildNG::OutStream &dest);

  private:
    IfDefCondition(Tokenizer &tokenizer,int flags);

    Glib::ustring     macro_name;
    bool              is_ifndef;
  };
}

